package cn.zyq.ykb.mapper.user;

import cn.zyq.ykb.beans.user.User;
import cn.zyq.ykb.beans.user.vo.GetUserNumberVo;
import cn.zyq.ykb.beans.user.vo.GetUserVo;
import cn.zyq.ykb.system.config.common.BaseMapper;
import com.alibaba.fastjson.JSONObject;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

/**
 * 用户表
 * 2023-04-02 09:09:22
 */
@Component
@Mapper
public interface UserMapper extends BaseMapper<User> {
    List<User> list(Map<String, Object> param);


    List<User> list1(Map<String, Object> param);
    /**
     * 设置用户编码
     *
     * @param userID
     */
    void setCodeByUserID(Integer userID);

    int updateAddWalletById(@Param("userID") Integer userID, @Param("wallet") BigDecimal money);

    int updateSubWalletById(@Param("userID") Integer userID, @Param("wallet") BigDecimal money);

    BigDecimal selectMoneyById(@Param("userID") Integer userID);

    /**
     * 更新用户的钱
     *
     * @param amount
     * @param userID
     * @return
     */
    int updateWallet(@Param("amount") BigDecimal amount, @Param("userID") Integer userID);
    /**
     * 更新用户的钱
     *
     * @param amount
     * @param userID
     * @return
     */
    int subWallet(@Param("amount") BigDecimal amount, @Param("userID") Integer userID);


    List<User> income(Map<String, Object> param);


    List<User> addIncome(Map<String, Object> param);

    GetUserNumberVo getUserNumber();

    List<GetUserVo> getRegisterNumber(@Param("time") String time, @Param("userIDs") String userIDs);


    GetUserNumberVo getUserNumber1(@Param("userID") Integer userID);

    int getTDZNum(Integer userID);
}
